<?php
namespace App\Http\Controllers\User;

use App\Models\Group;
use App\Models\Message;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Input;
use App\Http\Controllers\User\UserBaseController;
use Illuminate\Support\Facades\Auth;


class MessageController extends UserBaseController
{

    public function __construct() {
        parent::__construct();
    }


    //个人用户消息列表
    public function getIndex(Request $request)
    {
        $message = Message::where('corpid',$this->corpid)->where(function ($query) {
            $query->where('kind','1')->orWhere('kind','2')->where('to_user_id',$this->user->id)->orWhere('from_user_id',$this->user->id);
        })->get();
        $view = 'frontuser.message-center';
        return view($view)
            ->with('message', $message);
    }

}


